package com.sinux.generality.provider.demo.controller;



import com.sinux.generality.provider.demo.controller.base.BaseController;
import com.sinux.generality.provider.demo.entity.User;
import com.sinux.generality.provider.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sinux
 * @since 2023-05-06
 */
@Controller
@RequestMapping("/user")
public class UserController extends BaseController {

    @Resource
    private UserService userService;

    /**
     * 用户登录
     * @param user
     * @return
     */
    @RequestMapping(value = "/login")
    public Map<String, Object> login(@RequestBody User user)  {
        return userService.login(user);
    }

}

